﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Web.Profile;

namespace EHTWebsiteProject
{
    public partial class ActiveAccountSuccess : System.Web.UI.Page
    {
        /// <summary>
        /// ThinhDN
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ltrMessage1.Text = "Din konto har blitt aktivert";
            this.ltrMessage2.Text = "Logg inn";

            MembershipUser theUser = Membership.GetUser(Request.QueryString["user"].ToString());
            ProfileBase theProfile = ProfileBase.Create(Request.QueryString["user"].ToString());

            string StringActive = theProfile.GetPropertyValue("StringActive").ToString();
            if (StringActive == Request.QueryString["active"].ToString())
            {
                //this.ltrNotification.Text = theProfile.GetPropertyValue("StatusActive").ToString();
                theProfile.SetPropertyValue("StatusActive", 1);
                //this.ltrNotification.Text += "  " + theProfile.GetPropertyValue("StatusActive").ToString();
                theProfile.Save();
            }          
        }
    }
}